#ifndef MAINWINDOW_H
#define MAINWINDOW_H

#include <QMainWindow>
#include <QTextEdit>
#include <QTextCodec>
#include <QMenuBar>
#include <QMessageBox>
#include <QFileDialog>
#include <QTextStream>
#include <QToolBar>
#include <QLabel>

QT_BEGIN_NAMESPACE
namespace Ui { class MainWindow; }
QT_END_NAMESPACE

class MainWindow : public QMainWindow
{
    Q_OBJECT

public:
    MainWindow(QWidget *parent = nullptr);
    ~MainWindow();
private:
    Ui::MainWindow *ui;
    QTextCodec * codec; //处理中文
    QString currentFile; //当前文件名
    QMenuBar * mainMenu; //主菜单
    QTextEdit * textEdit; //编辑窗口
    QMenu * fileMenu; //文件菜单
    QAction *newAction;
    QAction *openAction;
    QAction *saveAction;
    QAction *saveAsAction;
    QMenu * editMenu; //编辑菜单
    QAction *pasteAction;
    QAction *copyAction;
    QAction *cutAction;
    QMenu * formatMenu; //格式菜单
    QAction *fontAction;
    QAction *colorAction;
    QMenu * helpMenu; //帮助菜单
    QAction *aboutAction;
    void setUI();


private slots:
    void NewFile();
    void OpenFile();
    void SaveFile();
    void SaveAsFile();
    void cut();
    void copy();
    void paste();
    void SetFont();
    void SetColor();
    void About();


};
#endif // MAINWINDOW_H
